<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>温(湿)度明细</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//设置当前层级
			if('${nowLevel}' != ""){
				$("#nowLevel").html("[" + "${nowLevel}" + "]");
			}
			var maps = '${resultMaps}';
			
			$(".icon-table").click(function(){
		      	var row = $(this).parent().parent().parent().find("tr").index($(this).parent().parent()[0]);
		     	var col = $(this).parent().parent().find("td").index($(this)[0]);
		      	val = $(".table").find("tr").eq(row+1).find("td").eq(0).text();
		      	openWindowsH400("${ctx}/ccsenhumidata/sensorHumiData/detailList?sensorMac="+val,$(".table").find("tr").eq(row+1).find("td").eq(1).text(),1000,668);
			});
			
			$(".icon-bar-chart").click(function(){
		      	var row = $(this).parent().parent().parent().find("tr").index($(this).parent().parent()[0]);
		     	var col = $(this).parent().parent().find("td").index($(this)[0]);
		      	val = $(".table").find("tr").eq(row+1).find("td").eq(0).text();
		     	openWindowsH400("${ctx}/ccsenhumidata/sensorHumiData/detailTempCharts?sensorMac="+val,$(".table").find("tr").eq(row+1).find("td").eq(1).text(),1000,668);
			});
			
		});
		
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        
        function closeTree(){
			var openCloseDiv = document.getElementById('openClose'); 
			openCloseDiv.click();
		}
		
		function openWindowsH400(url, title, w, h) {
			w = isNull(w) ? 1000 : w;
			h = isNull(h) ? 600 : h;
			var ww = ($(document).width() < w ? $(document).width() - 30 : w)
					+ "px";
			var hh = ($(document).height() < h ? $(document).height() - 30 : h)
					+ "px";
			layer.open({
				type : 2,
				area : [ ww, hh ],
				title : isNull(title) ? "历史数据明细" : title,
				fix : false, //不固定
				maxmin : false,
				shade : 0.3,
				shift : 0, //0-6的动画形式，-1不开启
				content : url,
				fix:false,
				move:false,
				moveOut:true
			});
		}
		
	</script>
	<style type="text/css">
		body{
			color: #000000;
		}
		#officeContent{
			border: none;
		}
		#nowLevel{
			color: #000;
		}
		
	</style>
</head>
<body>
	<div id="content" class="row-fluid">
		<div id="left">
			<div class="accordion-heading">
				<a class="accordion-toggle">组织树
					<i id="colseBtn" class="icon-remove pull-right" onclick="closeTree();"></i>
					<label id="nowLevel"></label>
				</a>
			</div>
			<iframe id="officeContent" src="${ctx}/cchierarchy/hierarchy/list" width="100%" height="95%"></iframe>
		</div>
		<div id="openClose" class="close">&nbsp;</div>
		<div id="right">
			<ul class="nav nav-tabs">
				<li><a href="${ctx}/ccsenhumidata/sensorHumiData/currentStatusCharts">实时数据图表</a></li>
				<li class="active"><a href="${ctx}/ccsenhumidata/sensorHumiData/currentStatus">温(湿)度明细</a></li>
			</ul>
			<form:form id="searchForm" modelAttribute="deviceInfo" action="${ctx}/ccsenhumidata/sensorHumiData/" method="post" class="breadcrumb form-search">
				<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			</form:form>
			<sys:message content="${message}"/>
			
			<div id="datadiv">
				<table id="contentTable" class="table table-striped table-bordered table-condensed">
					<thead>
						<tr  style="width:200px; height:35px;">
							<th style="display: none;">传感器编码</th>
							<th>探温点</th>
							<th>所属设备</th>
							<th>接种室</th>
							<th>品牌</th>
							<th>型号</th>
							<th>最低温度</th>
							<th>最高温度</th>
							<th>最后测量时间</th>
							<th>当前温度</th>
							<th>当前湿度</th>
							<th>类型</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${resultMaps}" var="map">
							<tr style="width:200px; height:35px;">
								<td id="mac" class="mac" style="display: none">${map.SENSOR_MAC}</td>
								<td>${map.SENSOR_NAME}</td>
								<td>${map.DNAME}</td>
								<td>${map.ROOM}</td>
								<td>${map.MANUFACTURER}</td>
								<td>${map.MODEL_NUMBER}</td>
								<td>${map.LOWER_TEMP}</td>
								<td>${map.UPPER_TEMP}</td>
								<td>${map.GET_TIME}</td>
								<%-- <td><span class="help-inline"><B><font color="green">${map.TEMP_BCD}</font></B></span></td> --%>
								<td><span class="label label-success"  style="text-align:center;width:50px;">${map.TEMP_BCD}</span></td>
								<td>${map.HUMI_BCD}</td>
								<td>${map.TYPE}</td>
								<!-- <td><input id="detailBtn" type="button" class="btn btn-primary" value="明细" />	</td> -->
								<td id="icon-bar-chart-td"><a id="icon-bar-chart" class="icon-bar-chart"></a>&nbsp; <a id="icon-table" class="icon-table"></a></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
			<div class="pagination">${page}</div>
		</div>
	</div>

	<script type="text/javascript">
	   		
		var leftWidth = "350"; // 左侧窗口大小
		var htmlObj = $("html"), mainObj = $("#main");
		var frameObj = $("#left, #openClose, #right, #right iframe");
		function wSize(){
			var strs = getWindowSize().toString().split(",");
			/* htmlObj.css({"overflow-x":"hidden", "overflow-y":"hidden"}); */
			mainObj.css("width","auto");
			frameObj.height(strs[0] - 5);
			var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
			$("#right").width($("#content").width()- leftWidth - $("#openClose").width() -5);
			$(".ztree").width(leftWidth - 10).height(frameObj.height() - 46);
		}
	</script>
	<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>
		
</body>
</html>